\(\int \frac {\cos (c+d x) (A+B \sin (c+d x))}{a+a \sin (c+d x)} \, dx\) [1006]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 29, antiderivative size = 36 \[ \int \frac {\cos (c+d x) (A+B \sin (c+d x))}{a+a \sin (c+d x)} \, dx=\frac {(A-B) \log (1+\sin (c+d x))}{a d}+\frac {B \sin (c+d x)}{a d} \]

[Out]

(A-B)*ln(1+sin(d*x+c))/a/d+B*sin(d*x+c)/a/d

Rubi [A] (verified)

Time = 0.04 (sec) , antiderivative size = 36, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.069, Rules used = {2912, 45} \[ \int \frac {\cos (c+d x) (A+B \sin (c+d x))}{a+a \sin (c+d x)} \, dx=\frac {(A-B) \log (\sin (c+d x)+1)}{a d}+\frac {B \sin (c+d x)}{a d} \]

[In]

Int[(Cos[c + d*x]*(A + B*Sin[c + d*x]))/(a + a*Sin[c + d*x]),x]

[Out]

((A - B)*Log[1 + Sin[c + d*x]])/(a*d) + (B*Sin[c + d*x])/(a*d)

Rule 45

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rule 2912

Int[cos[(e_.) + (f_.)*(x_)]*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)
])^(n_.), x_Symbol] :> Dist[1/(b*f), Subst[Int[(a + x)^m*(c + (d/b)*x)^n, x], x, b*Sin[e + f*x]], x] /; FreeQ[
{a, b, c, d, e, f, m, n}, x]

Rubi steps \begin{align*} \text {integral}& = \frac {\text {Subst}\left (\int \frac {A+\frac {B x}{a}}{a+x} \, dx,x,a \sin (c+d x)\right )}{a d} \\ & = \frac {\text {Subst}\left (\int \left (\frac {B}{a}+\frac {A-B}{a+x}\right ) \, dx,x,a \sin (c+d x)\right )}{a d} \\ & = \frac {(A-B) \log (1+\sin (c+d x))}{a d}+\frac {B \sin (c+d x)}{a d} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.03 (sec) , antiderivative size = 31, normalized size of antiderivative = 0.86 \[ \int \frac {\cos (c+d x) (A+B \sin (c+d x))}{a+a \sin (c+d x)} \, dx=\frac {(A-B) \log (1+\sin (c+d x))+B \sin (c+d x)}{a d} \]

[In]

Integrate[(Cos[c + d*x]*(A + B*Sin[c + d*x]))/(a + a*Sin[c + d*x]),x]

[Out]

((A - B)*Log[1 + Sin[c + d*x]] + B*Sin[c + d*x])/(a*d)

Maple [A] (verified)

Time = 0.19 (sec) , antiderivative size = 32, normalized size of antiderivative = 0.89

method result size
derivativedivides \(\frac {B \sin \left (d x +c \right )+\left (A -B \right ) \ln \left (1+\sin \left (d x +c \right )\right )}{d a}\) \(32\)
default \(\frac {B \sin \left (d x +c \right )+\left (A -B \right ) \ln \left (1+\sin \left (d x +c \right )\right )}{d a}\) \(32\)
parallelrisch \(\frac {\left (-A +B \right ) \ln \left (\sec ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (-2 B +2 A \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )+B \sin \left (d x +c \right )}{d a}\) \(55\)
risch \(-\frac {i x A}{a}+\frac {i x B}{a}-\frac {i B \,{\mathrm e}^{i \left (d x +c \right )}}{2 a d}+\frac {i B \,{\mathrm e}^{-i \left (d x +c \right )}}{2 a d}-\frac {2 i A c}{a d}+\frac {2 i B c}{a d}+\frac {2 \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) A}{a d}-\frac {2 \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) B}{a d}\) \(122\)
norman \(\frac {-\frac {2 B}{a d}-\frac {2 B \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a d}-\frac {2 B \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a d}-\frac {2 B \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}+\frac {2 \left (A -B \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{a d}-\frac {\left (A -B \right ) \ln \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a d}\) \(153\)

[In]

int(cos(d*x+c)*(A+B*sin(d*x+c))/(a+a*sin(d*x+c)),x,method=_RETURNVERBOSE)

[Out]

1/d/a*(B*sin(d*x+c)+(A-B)*ln(1+sin(d*x+c)))

Fricas [A] (verification not implemented)

none

Time = 0.30 (sec) , antiderivative size = 31, normalized size of antiderivative = 0.86 \[ \int \frac {\cos (c+d x) (A+B \sin (c+d x))}{a+a \sin (c+d x)} \, dx=\frac {{\left (A - B\right )} \log \left (\sin \left (d x + c\right ) + 1\right ) + B \sin \left (d x + c\right )}{a d} \]

[In]

integrate(cos(d*x+c)*(A+B*sin(d*x+c))/(a+a*sin(d*x+c)),x, algorithm="fricas")

[Out]

((A - B)*log(sin(d*x + c) + 1) + B*sin(d*x + c))/(a*d)

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 60 vs. \(2 (27) = 54\).

Time = 0.27 (sec) , antiderivative size = 60, normalized size of antiderivative = 1.67 \[ \int \frac {\cos (c+d x) (A+B \sin (c+d x))}{a+a \sin (c+d x)} \, dx=\begin {cases} \frac {A \log {\left (\sin {\left (c + d x \right )} + 1 \right )}}{a d} - \frac {B \log {\left (\sin {\left (c + d x \right )} + 1 \right )}}{a d} + \frac {B \sin {\left (c + d x \right )}}{a d} & \text {for}\: d \neq 0 \\\frac {x \left (A + B \sin {\left (c \right )}\right ) \cos {\left (c \right )}}{a \sin {\left (c \right )} + a} & \text {otherwise} \end {cases} \]

[In]

integrate(cos(d*x+c)*(A+B*sin(d*x+c))/(a+a*sin(d*x+c)),x)

[Out]

Piecewise((A*log(sin(c + d*x) + 1)/(a*d) - B*log(sin(c + d*x) + 1)/(a*d) + B*sin(c + d*x)/(a*d), Ne(d, 0)), (x
*(A + B*sin(c))*cos(c)/(a*sin(c) + a), True))

Maxima [A] (verification not implemented)

none

Time = 0.21 (sec) , antiderivative size = 34, normalized size of antiderivative = 0.94 \[ \int \frac {\cos (c+d x) (A+B \sin (c+d x))}{a+a \sin (c+d x)} \, dx=\frac {\frac {{\left (A - B\right )} \log \left (\sin \left (d x + c\right ) + 1\right )}{a} + \frac {B \sin \left (d x + c\right )}{a}}{d} \]

[In]

integrate(cos(d*x+c)*(A+B*sin(d*x+c))/(a+a*sin(d*x+c)),x, algorithm="maxima")

[Out]

((A - B)*log(sin(d*x + c) + 1)/a + B*sin(d*x + c)/a)/d

Giac [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 35, normalized size of antiderivative = 0.97 \[ \int \frac {\cos (c+d x) (A+B \sin (c+d x))}{a+a \sin (c+d x)} \, dx=\frac {\frac {{\left (A - B\right )} \log \left ({\left | \sin \left (d x + c\right ) + 1 \right |}\right )}{a} + \frac {B \sin \left (d x + c\right )}{a}}{d} \]

[In]

integrate(cos(d*x+c)*(A+B*sin(d*x+c))/(a+a*sin(d*x+c)),x, algorithm="giac")

[Out]

((A - B)*log(abs(sin(d*x + c) + 1))/a + B*sin(d*x + c)/a)/d

Mupad [B] (verification not implemented)

Time = 0.06 (sec) , antiderivative size = 36, normalized size of antiderivative = 1.00 \[ \int \frac {\cos (c+d x) (A+B \sin (c+d x))}{a+a \sin (c+d x)} \, dx=\frac {\ln \left (\sin \left (c+d\,x\right )+1\right )\,\left (A-B\right )}{a\,d}+\frac {B\,\sin \left (c+d\,x\right )}{a\,d} \]

[In]

int((cos(c + d*x)*(A + B*sin(c + d*x)))/(a + a*sin(c + d*x)),x)

[Out]

(log(sin(c + d*x) + 1)*(A - B))/(a*d) + (B*sin(c + d*x))/(a*d)